package com.gof.example.mediator;

/**
 * Created with IntelliJ IDEA.
 * Created by zhiyuan on 2018/5/11 08:25.
 * haiming.fei@tongdun.cn
 */
public class Window extends Mediator {

    private ListPane listPane;
    private TextPane textPane;
    private GraphicPane graphicPane;

    @Override
    void pannelChanged(Pannel pannel) {
        if (pannel instanceof ListPane) {
            System.out.println("listpannel changed");
            textPane.resize();
        } else if (pannel instanceof TextPane) {
            System.out.println("textPane changed");
            listPane.resize();
        } else {
            System.out.println("graphicPane changed");
            textPane.resize();
            listPane.resize();
        }
    }


    public void setListPane(ListPane listPane) {
        this.listPane = listPane;
    }

    public void setTextPane(TextPane textPane) {
        this.textPane = textPane;
    }

    public void setGraphicPane(GraphicPane graphicPane) {
        this.graphicPane = graphicPane;
    }
}
